-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Change ParamaterDecorator to allow an undefined propertyKey #53365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
`propertyKey` argument can be undefined for parameter decorators
(ignore the close/open; just fixing CI after I broke/unbroke main 🙃) |
OK! I was worried I did something wrong to have the tests break like that. 😌 |
This needs a backport to 5.0, right? @DanielRosenwasser |
@DanielRosenwasser: we may want to include this if we do any follow-up 5.0.x patches. It is a potentially breaking change, but is in line with the correctness change we made for parameter decorators that we mention in the 5.0 release notes. |
@typescript-bot cherry-pick this to release-5.0 |
Heya @jakebailey, I've started to run the task to cherry-pick this into |
Hey @jakebailey, I've opened #53392 for you. |
Component commits: 2c400b7 Update decorators.legacy.d.ts `propertyKey` argument can be undefined for parameter decorators
Technically any library that exports a `ParameterDecorator is potentially "wrong" today; but on the other hand, any existing code is probably sufficiently working anyway. So I think a cherry-pick is reasonable because it should unblock consumers, while helping library authors adapt. |
…e-5.0 (#53392) Co-authored-by: Daniel Hritzkiv <[email protected]>
…to release-5.0 (microsoft#53392) Co-authored-by: Daniel Hritzkiv <[email protected]>
propertyKey
argument can be undefined for constructor parameter decorators.I believe changes between 4.9 and 5.0 tightened up decorator type checking in some areas (#52435), while a newly introduced declaration file for legacy decorators doesn't reflect this change.
After upgrading to 5.0, I noticed that in my code, a dependency's usage of
ParameterDecorator
resulted in a type checking warning:Changing the
propertyKey
indecorators.legacy.d.ts
to allowundefined
fixed the type-checking error.I did not touch the other Decorator types as I don't know if the
propertyKey
issue affects them in the same way.Fixes #53312